import http from '@/utils/request'

const BASE_PATH = '/web/notice'

export const noticeList = params => http.get(`${BASE_PATH}/sys/notifications/selectList`, { params })

export const addNotice = params => http.post(`${BASE_PATH}/sys/notifications/save`, params)

export const deleteNotice = params => http.delete(`${BASE_PATH}/sys/notifications/delete`, { data: params })

export const updateNotice = (params) => http.put(`${BASE_PATH}/sys/notifications/update`, params)

export const userNoticeList = params => http.get(`${BASE_PATH}/sys/user/notifications/selectList`, { params })

export const slackAppInstall = params => http.get(`${BASE_PATH}/slack`, { params })

export const userUpdateNotice = (params, id) => http.put(`${BASE_PATH}/sys/user/notifications/${id}/update`, params)

export const userSaveNotice = params => http.post(`${BASE_PATH}/sys/user/notifications`, params)